﻿namespace JanusLibAing.Threading
{
    using EventsArg;

    /// <summary>
    /// Action Notification interface
    /// All information back come over this interface only
    /// </summary>
    public interface IActionNotification
    {
        /// <summary>
        /// Action started
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="arg"></param>
        void Started(object sender, ActionEventArgs arg);
        
        /// <summary>
        /// Action finished
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="arg"></param>
        void Finished(object sender, ExecutionCompletedEventArgs arg);

        /// <summary>
        /// Data Received
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="arg"></param>
        void DataReady(object sender, DataReadyEventArgs arg);

        /// <summary>
        /// Some error happens
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="arg"></param>
        void Error(object sender, ErrorEventArgs arg);

        /// <summary>
        /// Sets the listener. (Notification spy)
        /// It could be only one. Default function is not implemented. It is developer job implement the spy
        /// </summary>
        /// <param name="listenerIn">The listener.</param>
        void SetListener(IActionNotification listenerIn);

    }
}
